package com.ysyc.driver_ee.tools;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;

/**
 * @program: YSYC_Driver
 * @description: ${description}
 * @author: Mr.CHAN
 * @create: 2018-08-18 10:52
 **/
public class GlideUtil {
    public static void load(Context context,
                            String url,int errorIv,
                            int defaultIv,
                            ImageView imageView) {
        RequestOptions options = new RequestOptions()
                .error(errorIv)
                .placeholder(defaultIv);


        Glide.with(context)
                .load(url)
                .apply(options)
                .into(imageView);
    }

    public static void load(Context context,
                            String url,
                            ImageView imageView) {
        RequestOptions options = new RequestOptions();


        Glide.with(context)
                .load(url)
                .apply(options)
                .into(imageView);
    }

    public static void load(Context context,
                             int url,
                            ImageView imageView) {
        RequestOptions options = new RequestOptions();


        Glide.with(context)
                .load(url)
                .apply(options)
                .into(imageView);
    }

}
